package com.cyp.blogsystem.mapper;

import com.cyp.blogsystem.pojo.UserFollow;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

@Mapper
public interface UserFollowMapper {
  /**
   * 添加关注
   */
  int insert(UserFollow userFollow);

  /**
   * 取消关注
   */
  int delete(Long followerId, Long followingId);

  /**
   * 查询是否已关注
   */
  UserFollow selectByFollowerIdAndFollowingId(Long followerId, Long followingId);

  /**
   * 查询关注列表
   */
  List<UserFollow> selectFollowingList(Long followerId);

  /**
   * 查询粉丝列表
   */
  List<UserFollow> selectFollowerList(Long followingId);

  /**
   * 统计关注数
   */
  long countFollowing(Long followerId);

  /**
   * 统计粉丝数
   */
  long countFollower(Long followingId);
}